#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#define SWAP_BIT(x) (x = (((x & 0x55555555)<<1) + ((x & 0xaaaaaaaa)>>1)))
int main()
{
	int num = 0;
	scanf("%d", &num);
	SWAP_BIT(num);
	printf("%d\n", num);

	return 0;
}